home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20010306-20010921
/
000217_fdc@watsun.cc.columbia.edu_Tue Jun 19 10:49:05 EDT 2001.msg
< prev
next >
Wrap
Text File
|
2001-09-20
|
3KB
|
85 lines
Article: 12537 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.protocols.kermit.misc
Subject: Re: must write a soft including Kermit binary file send
Date: 19 Jun 2001 14:48:43 GMT
Organization: Columbia University
Lines: 68
Message-ID: <9gnoob$kn6$1@newsmaster.cc.columbia.edu>
References: <9ghrnm$m59$1@front1m.grolier.fr> <3b2dbe15$1_2@news.datacomm.ch> <9gl0kj$l64$1@newsmaster.cc.columbia.edu> <3b2f3dae$1_1@news.datacomm.ch>
NNTP-Posting-Host: watsun.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 992962123 21222 128.59.39.2 (19 Jun 2001 14:48:43 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 19 Jun 2001 14:48:43 GMT
Xref: newsmaster.cc.columbia.edu comp.protocols.kermit.misc:12537
In article <3b2f3dae$1_1@news.datacomm.ch>,
jean-luc <jgriess@caramail.com> wrote:
: please understand
: - The OS-9 stuf is given and working, also if it is a older Kermit version.
: - OS-9 is the target where "kermit ri" is waiting for files.
:
What kind of computer is sending the files? Does it have an operating
system?
: I was reading some of your source files, like ckcfn2.c and gkermit.c, so
: its a great help, know about S, F, D-type packets.
:
: The receiver OS-9 is waiting for files and send a NACK at regular
: intervalls
:
: NACK is 01 23 20 4E 33 0D
: where 01 is the start character
: where 23 20 is the sequence number
: where 4E ist the N for NACK
: where 0D is the block end
:
: what is the 33 for ?
: is this a checksumm ?
:
01 = Ctrl-A Start of packet
23 = # Length
20 = SP Sequence number
4E = N Type
33 = 3 Checksum
0D = CR Terminator
: I have problems with the checksumm calculation.
: I use the 1 Byte checksumm, type 1 so its all bytes anded with 177 and
: summed, add higher bits and anded with 77 I dont find that result.
:
Here's the formula from chk1() in ckcfn2.c:
chk = (((chk & 0300) >> 6) + chk) & 077;
chk is the sum of the length, sequence, type, and data fields. Before
application of the formula, this is:
23 + 20 + 4E = 91 (hex) = 221 (octal) = 145 (decimal)
In C, the numbers starting with 0 are octal. You could write this in
hexadecimal as:
chk = (((chk & 0xC0) >> 6) + chk) & 0x3F;
and in decimal as:
chk = (((chk & 192) >> 6) + chk) & 63;
Let's use hex, since that's what you used:
chk = (((chk & 0xC0) >> 6) + chk) & 0x3F;
chk = (((0x91 & 0xC0) >> 6) + 0x91) & 0x3F;
chk = ((0x80 >> 6) + 0x91) & 0x3F;
chk = (0x02 + 0x91) & 0x3F
chk = (0x93 & 0x3F)
chk = 13
Then to make it printable we add 20 (hex) = 33, which is ASCII "3".
It's all in the book. Maybe you can find a copy of it in your local
library.
- Frank